<div class="layuimini-main">

    <div class="layui-form layuimini-form">
        <div class="layui-form-item">
            <label class="layui-form-label required">费用类型</label>
            <div class="layui-input-block">
                <input type="text" name="name"  lay-verify="required" lay-reqtext="收费名称不能为空"
                       placeholder="请输入收费名称" value="" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">费用价格</label>
            <div class="layui-input-block">
                <input type="text" name="price" lay-verify="required" lay-reqtext="费用价格不能为空"
                       placeholder="请输入费用价格" value="" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">单位</label>
            <div class="layui-input-block">
                <input type="text" name="unit" lay-verify="required" lay-reqtext="计费单位不能为空"
                       placeholder="请输入计费单位" value="" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">收费类型</label>
            <div class="layui-input-block">
                <select name="type" lay-verify="required"  id="typeId" lay-search="">
                    <option value="">选择类型</option>
                    <option value="0">水电费</option>
                    <option value="1">物业费</option>
                    <option value="2">车位费</option>
                    <option value="3">宽带费</option>
                </select>
            </div>
        </div>



        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认添加</button>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form', 'table','laydate'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            laydate=layui.laydate,
            $ = layui.$;

        form.render();



        // 当前弹出层，防止ID被覆盖
        var parentIndex = layer.index;

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            //获取表单中的数据信息
            var datas=data.field;
            addOrUpdateSubmit($,"propertyType/add",datas);
            return false;
        });

    });
</script>